#!/usr/bin/python
# -*-coding: UTF-8 -*-
"""
# Time: 2021/10/26 22:24
# @Author: 修养
# @Project_name: PROJECT_NAME
"""
# 1、
test_string = "Hello"
for n in range(10):
    print('打印第', n + 1, '次', test_string)
# 2、
numbers = []
for n in range(4):
    m = int(input("输入列表的4个元素："))
    numbers.append(m)
print("列表为：", numbers)
for number in numbers:
    if number != 0:
        print(number, ',', end="")
    else:

        break


#
# # 3、
# def return_rate(amount, rate):
#     """
#     根据金额费率返回值
#     :param amount:
#     :param rate:
#     :return:
#     """
#     fee = amount * rate
#     if 0 < fee <= 10:
#         math = 'L1'
#     elif 10 < fee <= 20:
#         math = 'L2'
#     elif fee > 20:
#         math = 'L3'
#     else:
#         math = 'amount or rate is error!'
#     return math
#
#
# # 4、
# a = int(input('输入第一个10以内的数：'))
# b = int(input('输入第一个10以内的数：'))
# c = int(input('输入第一个10以内的数：'))
# numbers = [a, b, c]
# for number1 in numbers:
#     for number2 in numbers:
#         for number3 in numbers:
#             if (number1 != number2) and (number1 != number3) and (number2 != number3):
#                 print(number1, number2, number3, ',', end="")
#
#
# # 题目四
#
# def check_name(name):
#     """
#     以什么开头
#     :param name:
#     :return:
#     """
#     name = '' + name
#     if name.lower().startswith('all'):
#         print("输出：", True)
#     else:
#         print("输出：", False)
#
#
# #
# def check_end(name):
#     """
#     以什么结尾
#     :param name:
#     :return:
#     """
#     name = '' + name
#     if name.upper().endswith("US"):
#         print("True")
#     else:
#         print("False")
#
#
# def replace_all(name):
#     name = '' + name
#     if 'all' in name.upper() or '':
#         name = name.upper().replace("ALL", 'python')
#     print('输出：', name)
#
#
# # 五、
# def login(user_name, password):
#     if user_name == '.\\TerminUser' and password == 'Cmb147258':
#         print("登陆成功")
#         return True
#     else:
#         print("登录失败")
#         return False
#
#
# # 六
# sum = 0
# print(range(1, 101))
# for i in range(1, 101):
#     print(i)
#     sum = sum + i
# print("和为：", sum)
#
#
#
def remove_val(lists, val):
    test = []
    lists = test + lists
    for m in lists:
        lists.remove(val)
    n = len(lists)
    return n


# 题目八
def strStr(haystack, needle):
    str1 = '' + haystack
    str2 = '' + needle
    index = str1.find(str2)
    return index


# 九，回文数
def isHuiWen(num):
    num = '' + num


print('~~~~~~~~~~~~~输出~~~~~~~~~~~~~~~~~')
if __name__ == '__main__':
    s1 = 'heloo'
    s2 = 'll'
    index = strStr(s1, s2)
    print(index)
